package com.shuwen.gcdj.service.demo;

import com.shuwen.gcdj.entity.Demo1;
import com.shuwen.gcdj.entity.Demo2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @oauth 李东旭
 * @createDate 2021/11/17
 * @info
 */
@Service
public class DemoService {

    @Autowired
    private Demo1Service demo1Service;
    @Autowired
    private Demo2Service demo2Service;

    @Transactional
    public void save2(){
        Demo1 demo1DO = new Demo1();
        demo1DO.setName("test");
        Demo2 demo2DO = new Demo2();
        demo2DO.setName("test");
        demo1Service.save(demo1DO);
        demo2Service.save(demo2DO);
        int a = 1/0;
    }
}
